Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:03:40+00:00 2026-05-26T07:03:40+00:00

I want to to perform computations with large integers in SML, through functions like

  • 0

I want to to perform computations with large integers in SML, through functions like pow in this link:

http://www.standardml.org/Basis/int-inf.html#IntInf:STR:SPEC

But how do I get to use this “library”?


UPDATE:

Thanks for the answer. I got it. I also had to change the limit for printing with

Control.Print.intinfDepth := 10000;

I made my own pow function for IntInfs (and it works) like this:

fun power 0 = IntInf.toLarge 1
  | power n = IntInf.toLarge 2 * power(n-1);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:03:41+00:00Added an answer on May 26, 2026 at 7:03 am

    It depends on which implementation you use, but generally you need to convert your Int’s to LageInt/InfInf types with the Int.toLarge:

    (* will be types as an IntInf *)
    val aa = 10983298432984329843298432984329843298432987987987432987987987432987
    val a = IntInf.pow(aa,10);
    
    (* explicit type as if some other constraint had enforced this*)
    val b = 10 : int
    val c = Int.toLarge b;
    
    val d = IntInf.pow(c, b);
    

    The variable aa may not be parsed in your interpreter. It depends on what you use. I have tested it in poly and mlton.

    where the above gets the types (given by mlton with -show-basis flag):

    val a: intInf
    val aa: intInf
    val b: int32
    val c: intInf
    val d: intInf
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume that I want to perform parallel computations on a large fixed object, e.g.
I want to perform winsorization in a dataframe like this: event_date beta_before beta_after 2000-05-05
I want to perform a simple query like this in my PHP, SELECT noslots
I want to perform an onclick and onsubmit at the same time, is this
I want to perform some action when a link is clicked, I am using
I want to perform this date check: The date entered by the user should
I want to perform the action at a certain timeout, like fire an event.
I want to perform a hidden HTTP-GET request from MS-access, as simple as possible,
I want to perform a LIKE style comparison with an IN operator e.g.: select
I want to perform cascade delete for some tables in my database, but I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.