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

  • Home
  • SEARCH
  • 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 6582877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:20:11+00:00 2026-05-25T16:20:11+00:00

How to test if a number stored as string an exponential number (in Linux)?

  • 0

How to test if a number stored as string an exponential number (in Linux)?

I can use methods like scanning the numbers and finding if there exists an ‘e’, but i need a smarter way to find out.

Does there exist any API to quickly find out and tell if it is an exponential number?

I can use brute force approach like searching through the entire string, and getting a single ‘e’ followed by a +/- and then a number. But i need a quicker and smarter way, which consumes less machine cycles.

P.S: Exponential numbers are numbers like: 43e4, 23e-2 (any number with an e in between)

  • 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-25T16:20:12+00:00Added an answer on May 25, 2026 at 4:20 pm
    regex_t re;
    regcomp(&re, "^([0-9]+[.]?[0-9]*|[0-9]*[.][0-9]+)[eE][+-]?[0-9]+$", REG_EXTENDED);
    if (!regexec(&re, str, 0, 0, 0)) /* It's an "exponential number" */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to know the number of test methods in a test
I've got a stored procedure in Oracle: procedure Test(results OUT gencursor, id in number)
as a quick test of formatting very large, precise numbers i'm doing: (number is
I am trying to display a number, stored in a dataset as a string,
var x= 1; Number.prototype.test = function () { return this }; x.test() === x.test()
We have a number of electronic test technicians with next to no programming experience.
I have some written a number of unit tests that test a wrapper around
How do I keep a certain number of elements in an array? function test($var)
I'm running a NUnit test over a list of numbers. My code goes something
Part of my application maps resources stored in a number of locations onto web

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.