mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mahamuni ashish <ash_lkp@yahoo.co.in>
To: linux-kernel@vger.kernel.org
Subject: Floating Point Issue
Date: Thu, 27 Sep 2007 12:41:41 +0100 (BST)	[thread overview]
Message-ID: <109515.18343.qm@web7805.mail.in.yahoo.com> (raw)

I have small code....

#include <stdio.h>
#include <string.h>

int main()
{
float f= 1256.35;
char ch[4];

printf("\n1. f : %f",f);
memset(ch,'\0',strlen(ch) );
printf("\n2. f : %f",f);
return 0;
}

Expected output is
1. f : 1256.35
2. f : 1256.35

But I am getting the output
(on windows)
1. f : 1256.35
2. f : 0.000000

(on Linux)
1. f : 1256.35
segmentation fault

why?


      Forgot the famous last words? Access your message archive online at http://in.messenger.yahoo.com/webmessengerpromo.php


             reply	other threads:[~2007-09-27 15:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27 11:41 mahamuni ashish [this message]
2007-09-27 15:17 ` Jan Engelhardt
2007-09-28  2:32   ` WANG Cong
2007-09-27 15:21 ` Xavier Bestel
2007-09-27 15:29 ` Al Viro
2007-09-27 18:25 ` Trond Myklebust
2007-09-27 20:53 ` linux-os (Dick Johnson)
2007-09-27 21:01   ` Jan Engelhardt
2007-09-28  8:31 ` Bernd Petrovitsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=109515.18343.qm@web7805.mail.in.yahoo.com \
    --to=ash_lkp@yahoo.co.in \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome