Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

floating point

Name: Anonymous 2007-07-11 11:08 ID:1iiSAT9E

In the new C2009 standard, they should introduce an operator for floating point comparisons, to make up for the fact that == doesn't match numbers that are so very nearly the same (like, to 10 decimal places), but not equal.

As this new modern standard will support Ken Thompson's UTF-8 encoding, I would use the symbol "≈". For maximum flexibility, this will be both an infix operator and a function.

The function is defined as ≈(lvalue, rvalue, precision), where precision is an optional parameter specifying the number of binary places to compare. The operator assumes that precision is two binary places less than the least precise out of lvalue and rvalue (so if you're comparing a float and a double it'll take the precision of the float as a basis.)

What do you guys think of my proposal? I'm about to email it to Dennis Richie but am a bit delayed because pine only supports ASCII, so I'm recompiling it under Plan 9.

Name: ∀x≠α 2007-07-13 12:14 ID:CuqHqnwf

>>1
USE GNU EMACS 22 WITH ITS SUPERIOR MAIL/NEWS CLIENT GNUS AND DECENT UTF8 SUPPORT YOU FUCKING HERETIC.
Also, http://fcmp.sourceforge.net/

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List