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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:01:41+00:00 2026-06-14T23:01:41+00:00

To read an integer written in decimal form is quite simple : Prelude> read

  • 0

To read an integer written in decimal form is quite simple :

Prelude> read "1000000000" :: Int
1000000000

But how to read an integer written in exponetial form ?

Prelude> read "10e+9" :: Int
*** Exception: Prelude.read: no parse

Is there a function in the Prelude to do that, or do we need to parse the expression?

Thanks for any reply.

  • 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-14T23:01:42+00:00Added an answer on June 14, 2026 at 11:01 pm

    Depending on the exact format of the string, you could just read it into a floating point type:

    > read "10e+9" :: Double
    1.0e10
    

    then convert to an integral type — I’d recommend Integer instead of Int:

    > floor (read "10e+9" :: Double) :: Integer
    10000000000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read a integer binary file to int vector. When I use the Sort
I'm trying to read some binary datafiles. The datafiles have a sentinal integer written
I have written a simple program where to read the first 4 characters and
I get a warning in MSVC++ when I try to read an integer from
I read that JVM stores internally short, integer and long as 4 bytes. I
I need to read in a string and then an integer until the user
I have a console application written in c++. It simply reads an integer from
Say I have a binary file; it contains positive binary numbers, but written in
I have written the following code snippet to read data from the database :
I have written a boolean method which can be called upon to read information

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.