Hi Russel -
> However, GMP integers are not integers according to the Chapel
> compiler.
That's right; and they wouldn't be in C++ either... Nonetheless
I'd like to mention two things:
1) The BigInt support has recently been revamped
and we're working on getting that in to master. The 1st draft is here:
https://github.com/chapel-lang/chapel/pull/4243
2) We've talked about supporting arbitrary precision integers
at a more native level. We've talked about using some
syntax like int(_) or int(big) or something so that
the arbitrary precision would fit in with int(16)/int(64) etc.
If we did that, it would seem to be more apparent that
it should be possible to make a range over arbitrary precision
integers.
3) It seems to me that getting the range type to support arbitrary
precision integers is a reasonable TODO that could be taken on
once the recent BigInt improvements land. I don't think that
having other/better syntax for BigInt that makes it look more
like an integer really matters here. Also, I can't predict
(without trying it) if this is an easy change or a hard one.
So, I have two questions for you:
1) Would you be able to make a .future test that works with our
start_test testing system? In test/modules//standard/gmp ?
I don't know if you've done this before but we can help if
you need some pointers. Creating the .future file will help
us to track the feature request. (Of course, you or somebody
else in the community could go on to implement the improvements
necessary to the range type).
2) Is making a range of BigInts obviously important to some
Chapel program you are working on? If you can convince somebody
why it's important to work on that right away (vs other
priorities) it might get resolved sooner. I'm guessing it's
a "nice to have" and a TODO to record somewhere.
Cheers,
-michael
On 9/3/16, 5:46 AM, "Russel Winder" <[email protected]> wrote:
>I am revisiting Chapel implementation of Factorial – clearly a quasi-
>toy problem, but… As we know factorial of anything greater than 23(-
>ish) cannot be stored in 64-bit hardware integers, making hardware
>integers useless. This is not a totally trivial issue since large
>swathes of financial and bioinformatics computing relies of these big
>numbers and so relies on non-hardware integers. Python handles this
>well.
>
>For C++ I use GMP and there is a GMP module for Chapel, which is great.
>However, GMP integers are not integers according to the Chapel
>compiler. The expression:
>
> one..n
>
>where one and n are BigInt, results in:
>
> error: Bounds of 'low..high' must be integers of compatible
>types.
>
>which seems very strange. Or am I just missing something simple?
>
>--
>Russel.
>==========================================================================
>===
>Dr Russel Winder t: +44 20 7585 2200 voip:
>sip:[email protected]
>41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
>London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users