Jump to content

Math Issue


Holloweye
 Share

Recommended Posts

I'm sure there are more elegant solutions but you could simply convert to a string, swap the characters and convert back to an int again!

 

You can shift left and right in registers to do this sort of thing but that's in binary which isn't going to give the result you're after (not without going beyond my limited maths anyway lol). I am intrigued as to why you want to do this though!

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I'm sure there are more elegant solutions but you could simply convert to a string, swap the characters and convert back to an int again!

 

Yeah I know but i'am using assembly (Intel). And it get really messy when I do that so I figured if there was another solution.

Link to comment
Share on other sites

Now you have got me interested ... why assembly language .... what requires such speed that you're forced to use assembler or is it just an exercise ?

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

But school is meant that you solve things yourself (it's much more fun!), than ask other people. If you actively participate and teach the teacher (I had to teach my physics teacher that electrons are actually (at least) 5 dimensional, so they can appear in multiple places at the same time), all hours feel like 10 minutes to you, so you can speed up the time in school a lot too.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...