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 9126257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:59:49+00:00 2026-06-17T06:59:49+00:00

I do this operation and I want result without exponents : main(){ var result

  • 0

I do this operation and I want result without exponents :

main(){
  var result = ((1.1+2)+3.14+4+(5+6+7)+(8+9+10)*4267387833344334647677634)/2*553344300034334349999000;
  print(result); // With exponent
  print(result.toInt()); // Full number ?
}

And it print

3.18780189038289e+49
31878018903828901761984975061078744643351263313920

But the toInt() result is wrong, the good result is 31878018903828899277492024491376690701584023926880 . It check it with groovy (web) console.
How can I do to have my int full number ?

  • 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-06-17T06:59:51+00:00Added an answer on June 17, 2026 at 6:59 am

    As in result there are double literals, the result type is double.

    In Dart a double is a :

    64-bit (double-precision) floating-point numbers, as specified by the IEEE 754 standard

    This is why you lose precision.

    You can see the lost of precision with the following code :

    final bignum = 31878018903828899277492024491376690701584023926880;
    print(bignum);
    // displays 31878018903828899277492024491376690701584023926880
    print(bignum.toDouble().toInt());
    // displays 31878018903828901761984975061078744643351263313920
    

    This lost of precision is not specific to Dart, for instance 31878018903828899277492024491376690701584023926880.0 and 31878018903828901761984975061078744643351263313920.0 are equal in Java.

    The groovy web console gives you the right result because AFAICT groovy literals with decimal points are instantiated as java.math.BigDecimal by default.

    Finally there is an open issue on Decimal data type you can star and until decimals are natively supported, you can use my decimal package;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my operation i want to edit an employee list. In this time am
I have done this operation millions of times, just using the + operator! I
UnhandledException: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation at
I am trying to persist an object into the database. This operation should touch
Packaging operation failed - this message now showing while i try to make .ipa
Why does this code throw an Invalid Operation Exception? private SqlCommand cmd; // initialized
This is a general question, not related to a particular operation. I would like
this code is the base of lexer , and it does the basic operation
i'm getting dialogue box (Operation aborted) What is the problem in this code? <script
I am getting this exception: Collection was modified; enumeration operation may not execute. Directly

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.