Skip to content

YlmzCmlttn

Cemalettin Yılmaz Blog

Menu
  • Home
  • About Me
  • Projects
    • Iot-AR
    • Magnifi-AR
    • Smarthome-IOS
    • Others
  • Categories
    • Articles
    • Augmented Reality
    • Capture The Flag
      • Google CTF
        • 2018
    • Embedded Systems
    • IoT
    • Logisim
    • My Essays
    • Nvidia Jetson
      • Jetson TX1
    • Operating Systems
      • Kali
      • Raspbian
      • Ubuntu
    • Personal
    • Programming
      • Arduino
      • C
      • C#
      • Css
      • Html
      • Js
      • Matlab
      • Node.js
      • Python
      • Swift
      • VHDL
    • Projects
      • Embedded Systems
      • Electric
      • IoT
      • IoT-AR
      • Logisim
      • Magnifi-AR
      • Pose Estimation
    • Raspberry Pi
    • Xilinx
    • Others
Menu

atof stof stod problems with local floating point separator in C/C++

Posted on May 7, 2021 by Yılmaz Cemalettin

Today I encounter a problem with my C++ code. I try to convert string to double. Then I realize in my computer std::atof doesn’t work properly. Also others(stof stod) doesn’t not work correctly. Then I decide to find the issue. I write to simple script to print all output of those functions.

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//
#include <iostream>
#include <stdlib.h>
int main(int argc, char *argv[])
{
    std::string num = "3.5";
    std::cout<<num<<std::endl;
 
    double ret = std::atof(num.c_str());
    std::cout<<ret<<std::endl;
    std::cout<<ret+0.1<<std::endl;
 
    ret = std::stof(num);
    std::cout<<ret<<std::endl;
    std::cout<<ret+0.1<<std::endl;
 
    ret = std::stod(num);
    std::cout<<ret<<std::endl;
    std::cout<<ret+0.1<<std::endl;
    
    return 0;
 
}

Outputs:

1
2
3
4
5
6
7
8
//
3.5
3
3.1
3
3.1
3
3.1

…

Read more

Pico CTF 2019 Answers

Posted on May 20, 2020May 1, 2021 by Yılmaz Cemalettin

Pico CTF 2019 In this article, I will share my answers for picoCTF 2019. 0) The Factory’s Secret – Points: 1 There appear to be some mysterious glyphs hidden inside this abandoned factory… I wonder what would happen if you collected them all? -> I skip these task’s answer. I think able to solve this…

Read more

YZlib: Personal C++ Library

Posted on March 29, 2020April 2, 2020 by Yılmaz Cemalettin

YZlib Personal C++ Library I always want to create my own C++ library and today I decide to share my all experience when I create my own library. Generally, this library will be machine learning library. Right know, I don’t know anything about machine learning stuff. But I know, I must improve my linear algebra…

Read more

Drive to target | Google CTF 2019

Posted on July 7, 2019July 7, 2019 by Yılmaz Cemalettin

Google CTF 2019 Drive to target Excellent work! With your fine sleuthing skills, you managed to find a picture of the handsome creature with its pet biped. At last friends and companionship may be near! Like all inhabitants of this world, you spend an inordinate amount of time on the site, stalking and comparing your…

Read more

FriendSpaceBookPlusAllAccessRedPremium | Google CTF 2019

Posted on July 7, 2019July 7, 2019 by Yılmaz Cemalettin

Google CTF 2019 FriendSpaceBookPlusAllAccessRedPremium Having snooped around like the expert spy you were never trained to be, you found something that takes your interest: “Cookie/www.FriendSpaceBookPlusAllAccessRedPremium.com” But unbeknownst to you, it was only the 700nm Wavelength herring rather than a delicious cookie that you could have found. It looks exactly like a credential for another system….

Read more

AD | Google CTF 2019

Posted on July 6, 2019July 6, 2019 by Yılmaz Cemalettin

Google CTF 2019 AD We interrupt this program for a commercial break https://www.youtube.com/watch?v=QzFuwljOj8Y     CTF{9e796ca74932912c216a1cd00c25c84fae00e139}

Read more

STOP GAN | Google CTF 2019

Posted on July 6, 2019 by Yılmaz Cemalettin

Google CTF 2019 STOP GAN Well it seems someone can’t keep their work life and their home life separate. You vaguely recall on your home planet, posters put up everywhere that said “Loose Zips sink large commercial properties with a responsibility to the shareholders.” You wonder if there is a similar concept here. Using the…

Read more

Government Agriculture Network | Google CTF 2019

Posted on July 6, 2019 by Yılmaz Cemalettin

Google CTF 2019 Government Agriculture Network Well it seems someone can’t keep their work life and their home life separate. You vaguely recall on your home planet, posters put up everywhere that said “Loose Zips sink large commercial properties with a responsibility to the shareholders.” You wonder if there is a similar concept here. Using…

Read more

Posts navigation

  • 1
  • 2
  • 3
  • 4
  • …
  • 11
  • Next

My Motto

“Learn to share, Share to learn”

LinkedIn Badge

Cemalettin Yılmaz

Ads

Archives

Categories

  • Articles (1)
  • Augmented Reality (3)
  • Capture The Flag (23)
    • Google CTF (22)
      • 2018 (13)
      • 2019 (9)
    • PicoCTF (1)
      • 2019 (1)
  • Embedded Systems (3)
  • IoT (3)
  • Logisim (1)
  • My Essays (3)
  • Nvidia Jetson (5)
    • Xavier (5)
  • Operating Systems (24)
    • Kali (3)
    • Raspbian (2)
    • Ubuntu (21)
  • Others (1)
  • Personal (1)
  • Programming (44)
    • Arduino (4)
    • C (10)
    • C# (4)
    • C++ (5)
    • Css (1)
    • CUDA (6)
    • Html (1)
    • Js (2)
    • Libraries (5)
      • OpenCV (3)
      • OpenGL (2)
    • Matlab (14)
    • Node.js (5)
    • Python (6)
    • Swift (3)
  • Programs (4)
    • Tools (4)
  • Projects (21)
    • Books Solutions (8)
    • Electric (2)
    • Embedded Systems (2)
    • Energy Harvesting (1)
    • IoT (2)
    • IoT-AR (1)
    • Logisim (1)
    • Magnifi-AR (3)
    • Pose Estimation (3)
    • Smarthome-Ios (1)
  • Raspberry Pi (3)
  • Uncategorized (2)
  • YZlib (1)

Recent Posts

  • atof stof stod problems with local floating point separator in C/C++
  • Pico CTF 2019 Answers
  • YZlib: Personal C++ Library
  • Drive to target | Google CTF 2019
  • FriendSpaceBookPlusAllAccessRedPremium | Google CTF 2019

Recent Comments

  • AbaShelha on Ghidra Installation on Ubuntu |18.04, 16.04, 14.04
  • Peter on Ghidra Installation on Ubuntu |18.04, 16.04, 14.04
  • Yılmaz Cemalettin on Ghidra Installation on Ubuntu |18.04, 16.04, 14.04
  • Yılmaz Cemalettin on 16-Bit CPU on Logisim
  • Jenny on 16-Bit CPU on Logisim
  • MOON on 16-Bit CPU on Logisim
  • anti on Ghidra Installation on Ubuntu |18.04, 16.04, 14.04
  • hunkerjr on STOP GAN | Google CTF 2019
  • Shaq on 16-Bit CPU on Logisim
  • NURUL AFIQAH MOHD HASBULLAH on 16-Bit CPU on Logisim

Linkedln

© 2022 YlmzCmlttn | Powered by Superbs Personal Blog theme