For floating point numbers, generally the data is stored as a number 
(mantissa and exponent) which is magnitude only, and a separate sign bit 
(ie 1 for negative and 0 for positive).

Therefore, if the mantissa is 0 and the sign bit is 1, you have negative 
zero.  Which doesn't make any sense to people who are familiar with the 
idea of zero, but makes perfect sense to a computer which is only aware 
of a string of bits.

--Ben

Andy Ousterhout wrote:
> Can someone explain the concept of + or - zero?
> 
> Andy
> 
> -----Original Message-----
> From: Ryan Duckworth [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 05, 2005 2:19 PM
> To: CF-Talk
> Subject: RE: CF Allows Negative Zero?
> 
> 
> This function will solve your problem:  JavaCast('float',variableName)
> 
> 
> Ryan Duckworth
> Macromedia ColdFusion Certified Professional
> 
> Uhlig Communications
> 10983 Granada Lane
> Overland Park, KS 66211
> (913) 754-4272
> 
> -----Original Message-----
> From: Mark Drew [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 05, 2005 11:12 AM
> To: CF-Talk
> Subject: Re: CF Allows Negative Zero?
> 
> Can you owe nothing? how about if I give you nothing is that +0?
> 
> hmmm.. abstract
> 
> 
> On Wed, 5 Jan 2005 10:44:40 -0600, Dawson, Michael <[EMAIL PROTECTED]>
> wrote:
> 
>>If you enter a negative zero (-0), CF keeps it as is and does not
> 
> strip
> 
>>the negative sign.
>>
>>I would assume that is because CF may think this is a string, however,
>>it passes the IsNumeric() function.
>>
>>Should I just use the val() in my setter when I expect a numeric value
>>to be passed?
>>
>>Thanks
>>M!ke
>>
>>
> 
> 
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189456
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to