Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%1.6e prints 10.000000e+00 #98

Open
igor-m opened this issue Mar 17, 2021 · 1 comment
Open

%1.6e prints 10.000000e+00 #98

igor-m opened this issue Mar 17, 2021 · 1 comment

Comments

@igor-m
Copy link

igor-m commented Mar 17, 2021

Hi, with

printf_("%d degrees = %1.6e \n", i, tmp);

I get

169 degrees = 1.100000e+01                                                       
170 degrees = 10.000000e+00                                                      
171 degrees = 9.000000e+00 

Shouldn't it print "1.000000e+01" instead?

@eyalroz
Copy link

eyalroz commented Jul 14, 2021

How are you setting the values of i and tmp?

I'm getting 1.000000e+01 with:

#include <stdio.h>
#include "printf.h"

void _putchar(char character) {  putchar(character); }

int main()
{
    float tmp = 10.0;
    printf_("%1.6e\n", tmp);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants