SPUG:strange rounding problems

Tim Rosmus trosmus at nwnexus.net
Thu Jan 30 16:29:48 CST 2003


|# Unrounded: 12.7
|# Rounded: 13
|#
|# Ok so far.  But how about 12.5:
|#
|# Unrounded: 12.5
|# Rounded: 12
|#
|# Not quite right.  But 12.5000000001:
|#
|# Unrounded: 12.5000000001
|# Rounded: 13
|#

It's a result of the type of hardware/OS your running on.  Different
architectures, FP units (if available), and byte size will give
different results depending on what your running on.
-- 
                Tim Rosmus <trosmus at nwnexus.net>
                   Postmaster / USENET / DNS
                      Northwest Nexus Inc.



More information about the spug-list mailing list