To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 05 November 2004 10:42, Olaf van der Spek wrote:
> Mike Ford wrote:
> > for. (Some early business-oriented computers, and some calculators
> > (especially financial ones) did us
Mike Ford wrote:
for. (Some early business-oriented computers, and some calculators
(especially financial ones) did use a system called binary-coded
decimal -- BCD -- to calculate "accurately" in the sense you mean,
but the fact that they were never widely used and have died out
almost totally sho
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 01 November 2004 06:31, Brian T. Allen wrote:
[]
> When adding dollar amounts using only whole cents (and excluding the
> limitation we've been discussing) you should always
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Jason Wong" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, November 01, 2004 12:22 AM
Subject: Re: [PHP] Simple math failing - PHP Bug?
--- Jason Wong <[EMAIL PROTECTED]> wrote:
Most computer la
On Sun, 31 Oct 2004 23:30:53 -0700, Brian T. Allen <[EMAIL PROTECTED]>
wrote:
No worries, this isn't personal. I just want to explore this limitation
and it's implications for my benefit and the benefit of any that read
this thread later when they are searching for answers to a similar
pr
Brian T. Allen wrote:
Chris Shiflett wrote:
--- "Brian T. Allen" <[EMAIL PROTECTED]> wrote:
Well, in fairness, it's one of the worst ideas you've ever heard
because you know of this limitation.
Of course. That wasn't a dig at you or anything - just a comment. You're
free to heed or ignore it
Chris Shiflett wrote:
--- "Brian T. Allen" <[EMAIL PROTECTED]> wrote:
Well, in fairness, it's one of the worst ideas you've ever heard
because you know of this limitation.
Of course. That wasn't a dig at you or anything - just a comment. You're
free to heed or ignore it.
In reality, usin
--- "Brian T. Allen" <[EMAIL PROTECTED]> wrote:
> Well, in fairness, it's one of the worst ideas you've ever heard
> because you know of this limitation.
Of course. That wasn't a dig at you or anything - just a comment. You're
free to heed or ignore it.
> In reality, using a calculator or somethi
Chris Shiflett wrote:
--- Jason Wong <[EMAIL PROTECTED]> wrote:
Most computer languages handling floating point calculations
just as poorly. If accuracy is important use the BCMath
functions.
Or use Fortran and double precision. :-)
Still, testing a floating point number as a boolean is one
Thomas Goyne wrote:
On Sun, 31 Oct 2004 21:52:32 -0700, Brian T. Allen
<[EMAIL PROTECTED]> wrote:
Hi,
OK, I'm totally stumped by this. This should be the simplest math
imaginable (addition and subtraction), but PHP is coming up with the
wrong answer!
[snip]
Is this legitimately bad math o
--- Jason Wong <[EMAIL PROTECTED]> wrote:
> Most computer languages handling floating point calculations
> just as poorly. If accuracy is important use the BCMath
> functions.
Or use Fortran and double precision. :-)
Still, testing a floating point number as a boolean is one of the worst
ideas I'
On Monday 01 November 2004 04:52, Brian T. Allen wrote:
> OK, I'm totally stumped by this. This should be the simplest math
> imaginable (addition and subtraction), but PHP is coming up with the
> wrong answer!
>
> I've checked on 3 different machines (all linux) running both PHP 4 and
> PHP 5.
On Sun, 31 Oct 2004 21:52:32 -0700, Brian T. Allen <[EMAIL PROTECTED]>
wrote:
Hi,
OK, I'm totally stumped by this. This should be the simplest math
imaginable (addition and subtraction), but PHP is coming up with the
wrong answer!
[snip]
Is this legitimately bad math on the part of PHP?
T
i found the culprit. i remembered, that i use to pass the value with..
number_format($totalCost, 2, ".", ",")
so the values being received by my computation has a "," comma 4,000
so that is why i always get wrong values.
thanks again!
On Mon, 04 Oct 2004 00:02:32 -0700, Matthew Fonda <[EMAIL P
Howdy.
It seems to work fine for me, perhaps you have a typo along the lines
some where.
echoes 800
--
Regards,
Matthew Fonda
On Sun, 2004-10-03 at 23:26, Louie Miranda wrote:
> the percent of 20% is = .20 right?
> how can i compute the correct value for this?
>
> my $totalCost is $4,000 an
On Monday 04 October 2004 15:26, Louie Miranda wrote:
> the percent of 20% is = .20 right?
'don't know what's "the pecent of 20% is" ;) but in decimal
form, yes, it's right. Or, just ".2" or "0.2".
> how can i compute the correct value for this?
>
> my $totalCost is $4,000 and when i compute it t
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> Hi!
>
> I'm a little stuck with this simple math problem. I'm trying to get a
> number of days in integer, not float.
>
> --snip--
>$input_date = "12/16/2002";
>$UserInput = explode("/", $input_date);
>
>$UserInputMonth = $UserI
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> The int() function is for C/C++ programming only. This Int() function is
> not supported in PHP. In PHP it would be Intval(). For float, Floatval().
> For double, DoubleVal(). Etc. But beware of the Octual numbers.
You can cast like you can
> The int() function is for C/C++ programming only. This Int() function is
> not supported in PHP. In PHP it would be Intval(). For float,
Floatval().
> For double, DoubleVal(). Etc. But beware of the Octual numbers.
>
sorry, confusing my flash action script again :(
--
PHP General Maili
Gee! I forgot the '$'. It's been right there in my face. Thanks! I hope
the round() function work without a problem because I saw in some posting
that some people have this problem where if 3.51 is rounded, it return a 3.
"Seth - Kate Buntin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL P
The int() function is for C/C++ programming only. This Int() function is
not supported in PHP. In PHP it would be Intval(). For float, Floatval().
For double, DoubleVal(). Etc. But beware of the Octual numbers.
"Skate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> >$Day
I used your snip you just posted and changed the $Days = round(Days) to
$Days = round($Days) and got 228.
-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 9:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Simple Math Calculation Problem
Hi!
>$Days = (($clockDate - $inputDate) / (24 * 3600));
$Days = int(($clockDate - $inputDate) / (24 * 3600));
you tried that?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
11 % 3
On Sat, 20 Jan 2001 [EMAIL PROTECTED] wrote:
> Lets say I have 11 / 3
>
> answer is 2.667
>
> what if I want to get the remainder of it
> so 11 / 3 would be 2
>
> is there a built in function for this in PHP?
> kinda like MOD in Visual Basic?
>
> - Thanks
>
> --
> PHP General Mailing
24 matches
Mail list logo