On Tue, Jul 15, 2008 at 3:50 PM, tedd <[EMAIL PROTECTED]> wrote:
>
> Well, someone's client took infinity and turned it into an integral.
>
> tdd
Yeah, but they stole your 'e' to make up for it.
--
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no cont
[snip]
And then put it in Jay's pocket since we know he's skimming! If you're
lucky maybe he'll cut you in for not telling the boss :P
[/snip]
"Allegedly".
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Jul 16, 2008, at 11:39 AM, Shawn McKenzie wrote:
Jochem Maas wrote:
Robert Cummings schreef:
On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
Umm... here it is to unlimited precision: ¼
Cheers,
Rob.
Yeah and here's ƒ
Like or not, that's
Jochem Maas wrote:
Robert Cummings schreef:
On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
Umm... here it is to unlimited precision: ¼
Cheers,
Rob.
Yeah and here's ƒ
Like or not, that's all there is to it.
Weird... you're client bastar-diz
At 8:21 PM +0200 7/15/08, Jochem Maas wrote:
Robert Cummings schreef:
On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
Umm... here it is to unlimited precision: 14
Cheers,
Rob.
Yeah and here's
Like or not, that's all there is to it.
Weird
[snip]
Ask Jay, he's the skimming master! >:)
[/snip]
Bow down before mebut not too far lest ye be skimmed as well.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 2008-07-15 at 20:21 +0200, Jochem Maas wrote:
> Robert Cummings schreef:
> > On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
> >> At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
> >>> Umm... here it is to unlimited precision: ¼
> >>>
> >>> Cheers,
> >>> Rob.
> >> Yeah and here's ƒ
> >>
> >
On Tue, 2008-07-15 at 20:17 +0200, Jochem Maas wrote:
> Robin Vickery schreef:
> > 2008/7/15 tedd <[EMAIL PROTECTED]>:
> >> I said:
> >>
> >> "Round-off errors normally don't enter into things unless your doing
> >> multiplication and division operations."
> >>
> >> And that is not "Bull" -- it's t
Robert Cummings schreef:
On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
Umm... here it is to unlimited precision: ¼
Cheers,
Rob.
Yeah and here's ƒ
Like or not, that's all there is to it.
Weird... you're client bastar-dized my beautiful pi s
Robin Vickery schreef:
2008/7/15 tedd <[EMAIL PROTECTED]>:
I said:
"Round-off errors normally don't enter into things unless your doing
multiplication and division operations."
And that is not "Bull" -- it's true. You can add and subtract all the
floating point numbers (the one's we are talkin
tedd schreef:
At 4:45 PM -0400 7/14/08, Daniel Brown wrote:
That's as far OT as I'm going, but it's worth noting how
regulation doesn't do shit if it's not enforced.
The only thing that's regulated AND enforced is what you owe the
government.
actually your under no obligation to declare
On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
> At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
> >
> >Umm... here it is to unlimited precision: ¼
> >
> >Cheers,
> >Rob.
>
> Yeah and here's ƒ
>
> Like or not, that's all there is to it.
Weird... you're client bastar-dized my beautiful pi symbo
At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
Umm... here it is to unlimited precision: ¼
Cheers,
Rob.
Yeah and here's
Like or not, that's all there is to it.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (
On Tue, 2008-07-15 at 12:26 -0400, tedd wrote:
> At 4:52 PM +0100 7/15/08, Ford, Mike wrote:
> >On 15 July 2008 14:33, tedd advised:
> > > Mike:
> >>
> >> No reason to be rude.
> >>
> >> I said:
> >>
> >> "Round-off errors normally don't enter into things unless your doing
> >> multiplication
At 4:52 PM +0100 7/15/08, Ford, Mike wrote:
On 15 July 2008 14:33, tedd advised:
> Mike:
No reason to be rude.
I said:
"Round-off errors normally don't enter into things unless your doing
multiplication and division operations."
And that is not "Bull" -- it's true. You can add and subt
[snip]
So what you're saying is that you've been skimming for a while and the
fruits of your mislabour are adding up?
[/snip]
Not as far as you know. ;)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 2008-07-15 at 10:16 -0500, Jay Blanchard wrote:
> [snip]
> for most of what the majority of php/script apps deal with, it's
> probably
> safe to assume that addition/subtraction will be safe, but i can think
> of
> numerous examples where this isn't true...
> [/snip]
>
> As demonstrated by
On Tue, 2008-07-15 at 11:32 +0100, Ford, Mike wrote:
> On 14 July 2008 21:44, Jay Blanchard advised:
>
> > [snip]
> > So does that mean your problem is solved?
> > [/snip]
> >
> > It would appear so. I just need to remember to check for absolute
> values
> > when working with floats.
>
> Yeah, t
On 15 July 2008 16:07, bruce advised:
> anyone remember the intel debacle in the 1990's.. when they
> ate a couple
> hundred million when they had a math err in one of their coprocessors!
Oh, yes!
And then, back in the day, there was the DEC arithmetic processor which
hung if you happened to div
On 15 July 2008 14:33, tedd advised:
> At 11:24 AM +0100 7/15/08, Ford, Mike wrote:
>> On 14 July 2008 20:47, tedd advised:
>>
>> > Round-off errors normally don't enter into things unless your
doing
>> > multiplication and division operations. At that point,
> what you get
>>> back from the o
On Tue, Jul 15, 2008 at 11:16 AM, Jay Blanchard <[EMAIL PROTECTED]> wrote:
>
> the errors add up really quickly because the platforms are
> so darn much quicker than we are.
All I need to prove you wrong is an abacus and an old man with Parkinson's.
;-P
--
Dedicated Servers - Intel
[snip]
for most of what the majority of php/script apps deal with, it's
probably
safe to assume that addition/subtraction will be safe, but i can think
of
numerous examples where this isn't true...
[/snip]
As demonstrated by the example I provided, just checking the difference
(or lack thereof) be
hey had a math err in one of their coprocessors!
peace..
-Original Message-
From: tedd [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 6:33 AM
To: php php
Subject: RE: [PHP] Math Weirdness
At 11:24 AM +0100 7/15/08, Ford, Mike wrote:
>On 14 July 2008 20:47, tedd advised:
>
2008/7/15 tedd <[EMAIL PROTECTED]>:
>
> I said:
>
> "Round-off errors normally don't enter into things unless your doing
> multiplication and division operations."
>
> And that is not "Bull" -- it's true. You can add and subtract all the
> floating point numbers (the one's we are talking about here
At 11:24 AM +0100 7/15/08, Ford, Mike wrote:
On 14 July 2008 20:47, tedd advised:
> Round-off errors normally don't enter into things unless your doing
> multiplication and division operations. At that point, what you get
back from the operation is an approximation and not the actual
number
[snip]
> It would appear so. I just need to remember to check for absolute
values
> when working with floats.
Yeah, that's Computer Science 101 stuff. (Well, it was when I did my
degree 30+ years ago, so it's probably nearer primary school level by
now ;)
[/snip]
This is what happens when yo
On 14 July 2008 21:44, Jay Blanchard advised:
> [snip]
> So does that mean your problem is solved?
> [/snip]
>
> It would appear so. I just need to remember to check for absolute
values
> when working with floats.
Yeah, that's Computer Science 101 stuff. (Well, it was when I did my
degree 30+ y
On 14 July 2008 20:47, tedd advised:
> Round-off errors normally don't enter into things unless your doing
> multiplication and division operations. At that point, what you get
> back from the operation is an approximation and not the actual
> number.
Bull! Nearly all computer floating point numb
There's an algorithm known as banker's rounding that I thought all US
banks used. I'm on blackberry right now so I don't have a pointer, but
essentially you round to the nearest even cent. 1.5 goes to 2, as does
2.5.
Waynn
On 7/15/08, tedd <[EMAIL PROTECTED]> wrote:
> At 4:15 PM -0400 7/14/08,
At 4:45 PM -0400 7/14/08, Daniel Brown wrote:
That's as far OT as I'm going, but it's worth noting how
regulation doesn't do shit if it's not enforced.
The only thing that's regulated AND enforced is what you owe the government.
Don't get me started. :-)
Cheers,
tedd
--
---
http://
At 4:15 PM -0400 7/14/08, Robert Cummings wrote:
Nope, banks can't round like that when calculating your daily
interest :)
Cheers,
Rob.
I do know that when it comes to interest you pay them, they round up.
When it comes to interest they pay you, they round down -- and why
not? A decision h
[snip]
Yeah, I prefer to work with pennies too when doing that stuff. But
floats work much better when skimming... harder to track ;) Remind me
not to buy weed from Jay.
[/snip]
Hehehehehehe ;)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, Jul 14, 2008 at 4:28 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> I'm not completely sure about the U.S. but banks in Canada are
> regulated... fortunately :)
They are here, too, to a certain extent. The problem is, they can
create their own rules that cost the customer a fortun
> On Mon, 2008-07-14 at 16:25 -0400, Daniel Brown wrote:
> > On Mon, Jul 14, 2008 at 4:15 PM, Robert Cummings
> <[EMAIL PROTECTED]> wrote:
> > >
> > > Nope, banks can't round like that when calculating your daily
> > > interest :)
> >
> > If it works in their favor, you'd be surprised what they
[snip]
So does that mean your problem is solved?
[/snip]
It would appear so. I just need to remember to check for absolute values
when working with floats.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, 2008-07-14 at 16:25 -0400, Daniel Brown wrote:
> On Mon, Jul 14, 2008 at 4:15 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> > Nope, banks can't round like that when calculating your daily
> > interest :)
>
> If it works in their favor, you'd be surprised what they do.
> That's w
On Mon, Jul 14, 2008 at 4:15 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> Nope, banks can't round like that when calculating your daily
> interest :)
If it works in their favor, you'd be surprised what they do.
That's why extending TILA to banks in the US is such a big deal to me,
yet ge
On Mon, 2008-07-14 at 21:09 +0100, Alex Chamberlain wrote:
> [quote]
> I don't quite understand your problem, but I use integers for any monetary
> workings as you can guarantee it is accurate (obviously, you work in pence
> or cents rather than GBP or USD).
>
>
>
> Alex
>
>
> Hello Alex,
>
On Mon, 2008-07-14 at 15:00 -0500, Daniel Kolbo wrote:
> >
> > I don't quite understand your problem, but I use integers for any monetary
> > workings as you can guarantee it is accurate (obviously, you work in pence
> > or cents rather than GBP or USD).
> >
> >
> >
> > Alex
> >
>
> Hello Ale
[quote]
I don't quite understand your problem, but I use integers for any monetary
workings as you can guarantee it is accurate (obviously, you work in pence
or cents rather than GBP or USD).
Alex
Hello Alex,
I was reading through this thread, and I was curious about what methods you
use t
On Mon, Jul 14, 2008 at 4:00 PM, Alex Chamberlain
<[EMAIL PROTECTED]> wrote:
>
> Surely, for difference,
> $totChargeDiff = abs($endingBal - $totalCharges);
Yes, in live code. I gave my example to illustrate my point, not
to be used in code. I believe Jay would understand that.
--
Dedica
I don't quite understand your problem, but I use integers for any monetary
workings as you can guarantee it is accurate (obviously, you work in pence
or cents rather than GBP or USD).
Alex
Hello Alex,
I was reading through this thread, and I was curious about what methods
you use to
> On Mon, Jul 14, 2008 at 3:51 PM, Daniel Brown <[EMAIL PROTECTED]>
> wrote:
> >
> >You're performing math to get the result for $totChargeDiff by
> > subtracting $totalCharges from $endingBal. That will give you -0.10
> > in this case, because 0.10 - 0.20 = -0.10. You want the difference,
>
On Mon, Jul 14, 2008 at 3:54 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
>Oh, and the code, by the way:
>
> // your code to this point
>
> /* what is the difference between the ending balance and the charges? */
>$totChargeDiff = ($totalCharges > $endingBal) ?
> ($en
On Mon, Jul 14, 2008 at 3:51 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
>You're performing math to get the result for $totChargeDiff by
> subtracting $totalCharges from $endingBal. That will give you -0.10
> in this case, because 0.10 - 0.20 = -0.10. You want the difference,
> not the resu
On Mon, Jul 14, 2008 at 1:39 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> I am totally buffaloed by a set of very simple calculations that I am
> doing;
>
>$totChargeDiff = $endingBal - $totalCharges;
>echo number_format($totChargeDiff, 2, '.', '')."\t";
You'r
At 12:39 PM -0500 7/14/08, Jay Blanchard wrote:
Each number represented by a variable in all of these calculations has
been rounded to 2 decimal points at the point they are generated. For
the most part this works just hunky-dory but I have a handful of calcs
(out of 300k plus records) that look
On Mon, 2008-07-14 at 14:29 -0500, Jay Blanchard wrote:
> [snip]
> Isn't it possible then that your data is out of synch between the
> current balance and the previous day's ending balance?
> [/snip]
>
> No, the values are there and correct (it is done with a snapshot). The
> correct numbers are b
On Mon, 2008-07-14 at 15:33 -0400, Wolf wrote:
> Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote:
> > > [snip]
> > > So again... from whence do you conjure $endingBal? :)
> > > [/snip]
> > >
> > > $endingBal is conjured from the database
Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote:
> > [snip]
> > So again... from whence do you conjure $endingBal? :)
> > [/snip]
> >
> > $endingBal is conjured from the database tracking the account balance.
> > For any 24 hour period the
[snip]
Isn't it possible then that your data is out of synch between the
current balance and the previous day's ending balance?
[/snip]
No, the values are there and correct (it is done with a snapshot). The
correct numbers are being used in the math (as shown). When I do
this(as you suggested)
On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote:
> [snip]
> So again... from whence do you conjure $endingBal? :)
> [/snip]
>
> $endingBal is conjured from the database tracking the account balance.
> For any 24 hour period the beginning and ending balance for subsequent
> days is the same
> I am totally buffaloed by a set of very simple calculations that I am
> doing;
>
> /* calculate total balance with payments and adjustments */
> $totalBalance = $acct['BALANCE'] + $adjBalance;
> echo number_format($totalBalance, 2, '.', '')."\t";
>
> /* calculate total
[snip]
So again... from whence do you conjure $endingBal? :)
[/snip]
$endingBal is conjured from the database tracking the account balance.
For any 24 hour period the beginning and ending balance for subsequent
days is the same unless adjustments or payments have been made to the
account in that p
On Mon, 2008-07-14 at 12:39 -0500, Jay Blanchard wrote:
> I am totally buffaloed by a set of very simple calculations that I am
> doing;
>
> /* calculate total balance with payments and adjustments */
> $totalBalance = $acct['BALANCE'] + $adjBalance;
> echo number_format($totalBalance,
[snip]
What makes you think the problem is in this code? How about doing the
following right before the block of code you've provided so that we can
actually check the data with what you're using:
[/snip]
$adjBalance: 0
$intlLDCharges: 0.2
$longDistance: 0
$smsCharges: 0
$roaming: 0
$daCharges:
On Mon, 2008-07-14 at 12:39 -0500, Jay Blanchard wrote:
> /* calculate total balance with payments and adjustments */
> $totalBalance = $acct['BALANCE'] + $adjBalance;
> echo number_format($totalBalance, 2, '.', '')."\t";
>
> /* calculate total charges */
>
jon roig wrote:
Ok... It's Friday and maybe my brain is dead, but I'm having a weird
problem with some basic math.
Here's a little snippet of the code I'm working with:
---
echo "Current:$currentAmount:".gettype($currentAmount)." -
Paid:$paidAmount:".gettype($paidAmount).""
riginal Message-
> From: Daniel Clark [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 27, 2004 3:16 PM
> To: jon roig
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Math weirdness with doubles...
>
>
> Looks like the Doubles are not exactly zero. Must be some precision
&g
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Math weirdness with doubles...
Looks like the Doubles are not exactly zero. Must be some precision
points not displaying.
> Ok... It's Friday and maybe my brain is dead, but I'm having a weird
> problem with some basic math.
>
> H
They are not the same amount. They each got a different rounding error.
Double values only display a small number of decimal places
(relatively speaking). If you look at the difference you're getting,
it's 0.0142108547152 (I may be off by a zero or two), so
given you're working w
Looks like the Doubles are not exactly zero. Must be some precision
points not displaying.
> Ok... It's Friday and maybe my brain is dead, but I'm having a weird
> problem with some basic math.
>
> Here's a little snippet of the code I'm working with:
>
> ---
> echo "Curr
62 matches
Mail list logo