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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:12:34+00:00 2026-05-26T10:12:34+00:00

In my program some computation could generate 1.#INF00 or -1.#IND00 results I want to

  • 0

In my program some computation could generate 1.#INF00 or -1.#IND00 results
I want to print these results – but not as 1.#INF00 and -1.#IND00 .For example for 1.#INF00 , I want to print “infinity”

infinity_print(computation(x));//results infinity result 1.#INF00

will cause “infinity” to appear on the screen

How infinity_print could be implemented?

  • 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-26T10:12:34+00:00Added an answer on May 26, 2026 at 10:12 am

    You could use isinf(y) macros in c99. Otherwise it depends on your compiler, OS, architecture — different implementations have various drawbacks.

    Here’s some of possible variants:

    #include <math.h> /* isinf */
    
    #ifndef isinf
    /* Microsoft C defines _MSC_VER */
    #ifdef _MSC_VER
    #  include <float.h>
    /* 
       from Python source: PC/pyconfig.h Py_IS_INFINITY
    */
    #  define isinf(X) (!_finite(X) && !_isnan(X))
    #else
    #  ifndef isnan
    /*
       http://www.gnu.org/software/hello/manual/autoconf/Function-Portability.html
    */
    #    define isnan(X) isnan_d(X)
    static inline int isnan_d  (double x) { return x != x; }
    #  endif /* !isnan */
    #  define isinf(X) isinf_d(X)
    static inline int isinf_d  (double x) { return !isnan (x) && isnan (x - x); }
    #endif /* _MSC_VER */
    #endif /* !isinf */
    
    #ifdef gnulib
    /*
       http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/isinf.c;hb=HEAD
    */
    #undef isinf
    #define isinf(X) gl_isinfd(X)
    #include <float.h>
    static inline int gl_isinfd (double x) { return x < -DBL_MAX || x > DBL_MAX; }
    #endif /* gnulib */
    

    For float, long double the implementations are similar.

    Example

    #include <stdio.h>
    
    int main() {
      double x = 1./0;
    
      printf("%g", x);
      if (isinf(x))
        puts(" infinity");
      puts("\n");
    
      return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried to install some program, it gives above message requiring 1.1.4322. BUT as the
I have a some computation program. Now, this program is a single-thread, I need
I've been having a bug in my code for some time and could not
I wrote a multi-threaded program which does some CPU heavy computation with a lot
Looking for some help with a Labview data collection program. If I could collect
I'm writing an analyzer,which shows the packets of a specific program.Some packets are very
Question What would be a good (ideally, technical) reason to ever program some non-trivial
My program does some network activity in a background thread. Before starting, it pops
My program uses some external programs that i included in the Files folder. In
I am developing some program in C# which will send the mail using outlook

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.