Re: Smooth numeric upgrades?

2008-12-11 Thread TSa
HaloO, Darren Duncan wrote: Michael G Schwern wrote: TSa (Thomas Sandlaß) wrote: I want to stress this last point. We have the three types Int, Rat and Num. What exactly is the purpose of Num? The IEEE formats will be handled by num64 and the like. Is it just there for holding properties? Or

Re: Smooth numeric upgrades?

2008-10-20 Thread Tom Christiansen
On Mon, 06 Oct 2008 at wee small hour of 02:20:22 EDT you, Michael G Schwern [EMAIL PROTECTED], wrote: Darren Duncan wrote: [2] Num should have an optional limit on the number of decimal places it remembers, like NUMERIC in SQL, but that's a simple truncation. I disagree. Any

Re: Smooth numeric upgrades?

2008-10-06 Thread Michael G Schwern
So, the concrete use-case I'm thinking of here is currency. Darren Duncan wrote: [2] Num should have an optional limit on the number of decimal places it remembers, like NUMERIC in SQL, but that's a simple truncation. I disagree. For starters, any limit built into a type definition

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Darren Duncan wrote: 4.5207196*10**30 - 45207196*10**37 Before anyone nitpicks, I meant to say on that line: 4.5207196*10**44 - 45207196*10**37 -- Darren Duncan

Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
Darren Duncan wrote: Patrick R. Michaud wrote: Correct. I suspect that eventually the Rakudo developers will have to develop a custom set of PMCs for Perl 6 behaviors rather than relying on the Parrot ones. I think it would be better for things like unlimited-precision integers and

Re: Smooth numeric upgrades?

2008-10-05 Thread TSa (Thomas Sandlaß)
HaloO, On Sunday, 5. October 2008 04:23:42 Darren Duncan wrote: Note that just as integers are naturally radix independent, the unlimited rationals should be too, and the latter can compactly represent all rationals as a triple of integers corresponding roughly to a (normalized) [mantissa,

Re: Smooth numeric upgrades?

2008-10-05 Thread Doug McNutt
On Sunday, 5. October 2008 04:23:42 Darren Duncan wrote: Note that just as integers are naturally radix independent, the unlimited rationals should be too, and the latter can compactly represent all rationals as a triple of integers corresponding roughly to a (normalized) [mantissa, radix,

Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
TSa (Thomas Sandlaß) wrote: I want to stress this last point. We have the three types Int, Rat and Num. What exactly is the purpose of Num? The IEEE formats will be handled by num64 and the like. Is it just there for holding properties? Or does it do some more advanced numeric stuff? Int, Rat

Re: Smooth numeric upgrades?

2008-10-05 Thread Nicholas Clark
On Sat, Oct 04, 2008 at 09:37:29PM -0700, Mark Biggar wrote: trivial and vice versa. But promotion (or demotion) between IEEE floats and rationals is really hard and I don't know of a language that even tries. The major problem is that the demotion from rational to IEEE float is very

Re: Smooth numeric upgrades?

2008-10-05 Thread Tom Christiansen
In-Reply-To: Message from Nicholas Clark [EMAIL PROTECTED] of Sun, 05 Oct 2008 22:13:14 BST. [EMAIL PROTECTED] Studiously ignoring that request to nail down promotion and demotion, I'm going to jump straight to implementation, and ask: If one has floating point in the mix [and however

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Michael G Schwern wrote: TSa (Thomas Sandlaß) wrote: I want to stress this last point. We have the three types Int, Rat and Num. What exactly is the purpose of Num? The IEEE formats will be handled by num64 and the like. Is it just there for holding properties? Or does it do some more advanced

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Nicholas Clark wrote: If one has floating point in the mix [and however much one uses rationals, and has the parser store all decimal string constants as rationals, floating point enters the mix as soon as someone wants to use transcendental functions such as sin(), exp() or sqrt()], I can't see

Re: Smooth numeric upgrades?

2008-10-04 Thread Michael G Schwern
Larry Wall wrote: On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: : What's the status of numeric upgrades in Perl 6? Is see the docs say Perl 6 : intrinsically supports big integers and rationals through its system of type : declarations. Int automatically supports

Re: Smooth numeric upgrades?

2008-10-04 Thread Tom Christiansen
In-Reply-To: Message from Michael G Schwern [EMAIL PROTECTED] of Sat, 04 Oct 2008 02:06:18 EDT. [EMAIL PROTECTED] Larry Wall wrote: The status of numeric upgrades in Perl 6 is fine. It's rakudo that doesn't do so well. :) As another datapoint: $ pugs -e 'say 2**40' 1099511627776 $

Re: Smooth numeric upgrades?

2008-10-04 Thread Patrick R. Michaud
On Fri, Oct 03, 2008 at 09:47:38PM -0700, Larry Wall wrote: On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: : What's the status of numeric upgrades in Perl 6? Is see the : docs say Perl 6 intrinsically supports big integers and rationals : through its system of type

Re: Smooth numeric upgrades?

2008-10-04 Thread Bob Rogers
From: Patrick R. Michaud [EMAIL PROTECTED] Date: Sat, 4 Oct 2008 09:41:22 -0500 On Fri, Oct 03, 2008 at 09:47:38PM -0700, Larry Wall wrote: On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: : What's the status of numeric upgrades in Perl 6? Is see the :

Re: Smooth numeric upgrades?

2008-10-04 Thread Bob Rogers
From: Bob Rogers [EMAIL PROTECTED] Date: Sat, 4 Oct 2008 22:08:10 -0400 From: Patrick R. Michaud [EMAIL PROTECTED] Date: Sat, 4 Oct 2008 18:15:57 -0500 . . . All of the mechanisms I've been able to find in Parrot for converting an arbitrary PMC to a number

Smooth numeric upgrades?

2008-10-03 Thread Michael G Schwern
What's the status of numeric upgrades in Perl 6? Is see the docs say Perl 6 intrinsically supports big integers and rationals through its system of type declarations. Int automatically supports promotion to arbitrary precision but it looks like it's doing the same thing as Perl 5. $ ./perl6 -e

Re: Smooth numeric upgrades?

2008-10-03 Thread Larry Wall
On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: : What's the status of numeric upgrades in Perl 6? Is see the docs say Perl 6 : intrinsically supports big integers and rationals through its system of type : declarations. Int automatically supports promotion to arbitrary