ID:               20346
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Math related
 Operating System: Darwin 6.1 (Mac OS X.2.1)
 PHP Version:      4CVS-2002-11-10
 New Comment:

Nope, it isn't a precision problem, it is a regular old PEKAC error or
ID 10 T error. Sorry for bothering you.


Previous Comments:
------------------------------------------------------------------------

[2002-11-10 16:23:24] [EMAIL PROTECTED]

http://www.php.net/manual/en/print/language.types.float.php

------------------------------------------------------------------------

[2002-11-10 16:21:13] [EMAIL PROTECTED]

Ummmm.... could you please explain why this isn't an error in PHP? It
is only simple math and PHP is giving me an incorrect result.

------------------------------------------------------------------------

[2002-11-10 15:48:16] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

------------------------------------------------------------------------

[2002-11-10 15:44:44] [EMAIL PROTECTED]

On this one, I really don't have a clue what is wrong with PHP. Run the
script shown below. Results should be "c" == "d" == "e", but "e" is
some other value. I noticed that if you comment out the "$temp_x = ..."
line (which shouldn't matter anyway) you get the correct answer for
"e". I need this to convert a vector to unit length (which should be
simple enough) and I thought that I was going crazy.

If you want to see how PHP is configured, look here:
http://144.92.10.251/~sage/test.php

<?php
$temp_x = .0663;
$temp_y = .01486;

print "a=" . $temp_x . ", b=" . $temp_y . ", c=" .
        (.0148 / sqrt( .0663 * .0663 + .01486 * .01486 ) ) . ", d=" .
        ($temp_y / sqrt( ( $temp_x * $temp_x ) + ( $temp_y * $temp_y ) ));

$temp_x = $temp_x / sqrt(($temp_x * $temp_x ) + ( $temp_y * $temp_y )
);

$temp_y = $temp_y / sqrt(($temp_x * $temp_x ) + ( $temp_y * $temp_y )
);

echo ", e=" . $temp_y;
?>

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20346&edit=1

Reply via email to