Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Numeric comparison bug
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Simon Glover  
View profile  
 More options Mar 16 2004, 4:49 pm
Newsgroups: perl.perl6.internals
From: bugs-par...@netlabs.develooper.com (Simon Glover)
Date: Tue, 16 Mar 2004 13:02:11 -0800
Local: Tues, Mar 16 2004 4:02 pm
Subject: [perl #27690] Numeric comparison bug
# New Ticket Created by  Simon Glover
# Please include the string:  [perl #27690]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=27690 >

 This code:

        new P0, .PerlNum
        set P0, -1.2
        new P1, .PerlString
        set P1, "-1.2"
        eq_num P0, P1, OK
        print "not "
OK:     print "ok\n"
        end

 prints "not ok", when it should print "ok". A similar problem exists with
 the ne_num op, suggesting the underlying bug is somewhere in the
 implementation of the cmp_num vtable function.

 [And yes, I'm well aware of the problems inherent in doing floating point
  comparisons. However, in this case, the floating-point respresentation
  of the string '1.2' should be exactly the same as the representation of
  the number 1.2, since the former is converted into the latter
  internally]

 Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.