Convert floating point or double base-10 value to any other base (and vice-versa)?

조회 수: 1 (최근 30일)
YC
YC 2020년 4월 20일
답변: YC 2020년 4월 22일
Hello, I am using the dec2base and base2dec functions right now, but I have some floating values I want to convert to other bases. For example, '5.5' in base-10 converted to base-5 should return '10.2222222'.
How may I convert float or double values to different bases correctly? I do not intend to convert to bases higher than 10
Thank you for reading.
  댓글 수: 2
Stephen23
Stephen23 2020년 4월 20일
편집: Stephen23 2020년 4월 20일
How do you intend to represent digits >9 ?
Or, assuming that you follow the hexadecimal tradition of using A, B, etc., digits greater than >Z ?
"How may I convert float or double values to different bases correctly"
I already told you that in my answer to your last question (just change the 16 to whatever base you want).
YC
YC 2020년 4월 20일
My bad, forgot to mention, I only need base 10 conversions and below! Edited question to answer your comment

댓글을 달려면 로그인하십시오.

답변 (1개)

YC
YC 2020년 4월 22일
New thread here looking for advice on how to correctly convert base-10 floating points to other bases (specifically bases higher than 10), includes a code which will already convert to bases below 10

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by