dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 15 February 2010, 23:33 PM Post subject: Re: Float mantissa, negative integer exponent |
|
|
| GTBecker wrote: | | Code: | | console.writeline(cstr((10.0^-2))) ' yields &.& ? |
| This occurs because integral constants are represented internally as unsigned 32-bit values so the effect is the same as 10.0 ^ &Hfffffffe. The fact that the negative sign is present is stored along with the constant so this probably can be made to work as you were expecting it to work.
In the mean time, you can force the desired behavior by making it clear that you want the exponent treated as a signed value, e.g. | Code: | | console.writeline(cstr((10.0^CInt(-2)))) |
|
|