Wrox Programmer Forums
|
BOOK: Beginning Java 2, JDK 5 Edition
This is the forum to discuss the Wrox book Ivor Horton's Beginning Java 2, JDK 5 Edition by Ivor Horton; ISBN: 9780764568749
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2, JDK 5 Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2005, 12:37 AM
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Comparing floating point variables

Hi everyone,
I am currently reading pae 57 in the book and it talks about the method ulp(). Would that method be used to check equality between 2 floating point values ?

I know we are not supposed to compare 2 FP values directly, but check if they are within the range of the unit in the last place .....

can anyone provide a quick snippet of code on how i would use ulp() for the situation described above.

Thanks
Patrick Picard






Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two variables by using = operator in xsl saurabh_inblore XSLT 1 February 2nd, 2007 05:22 AM
Help Floating Point Accuracy righty Java Basics 0 January 28th, 2007 12:35 AM
Formating Floating point atoyot Visual Basic 2005 Basics 2 April 26th, 2006 08:36 PM
Stupid Problem... on comparing variables! Varg_88 Classic ASP Basics 1 December 11th, 2004 06:00 PM
A weird problem with floating point ? tzecheung Javascript 1 June 25th, 2003 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.