Subject | Re: IB dumber than a $5 calculator |
---|---|
Author | rrokytskyy |
Post date | 2002-05-30T13:59:26Z |
> The problem is this:18 feet, now I
>
> Take the diameter of an old metal swimming pool I had in the 1970's
> want the circumference in metres.(20)
>
> 'Calc = ' || '18' * .3048 * '3.14' the output variable is a VARCHAR
>3.14 to a double, do
> what it really needs to do is convert the 18 to a double and the
> the math and cast the result to a string, concatenate that to anystrings and sanity
> check the result for length. In this case the result would be Calc= 17.227296 at
> least according to my Canon F-502 calculator.Do not want to comment your statement about IB, but the right
statement would be:
'Calc = ' || ('18' * .3048 * '3.14')
at leaset this works:
select 'Calc = ' || ('18' * .3048 * '3.14') from rdb$database
Usually statements are evaluated from left to right, and there is not
precedence between * and || operators.
Best regards,
Roman Rokytskyy