Python Forum
How to do "fixed size" (wrapping) math in Python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to do "fixed size" (wrapping) math in Python?
#7
Well, thanks for the info. That's all interesting, but I think it is not what I need.

Look, I have "reference" code in C. That's just a simple C function. I could add a main() function to call the function that implements the algorithm and then compile an .exe file. But I don't see how that helps me with the Python project, or how I would invoke that from the Python code. And, even if I somehow could create an .exe (or .dll) file that can be invoked from Python code, it would not really solve the task. We need an implementation of the algorithm as "portable" Python code that works on different platforms and, ideally, with all Python interpreters (not only CPython). I think porting the code actually shouldn't be too hard, if it wasn't for the "mod 2^64" arithmetic stuff. So, thanks again for your suggestions so far, but can we please discuss the original question?

Quote: So, given that we need to port the algorithm to Python, is there any recommended/idiomatic way to do "fixed-size" (wrapping) arithmetic ???

I mean, a lot of algorithms, like hash functions and stuff, are defined with "fixed-size" (wrapping) arithmetic. So, this doesn't seem like an unusual requirement. How is it usually done in Python?

Thank you!
Reply


Messages In This Thread
RE: How to do "fixed size" (wrapping) math in Python? - by AlexanderWulf - Jul-18-2023, 01:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python 3.13 : def setup size HansieB 6 1,328 Dec-02-2024, 11:12 AM
Last Post: buran
  Python code for alignment and font size 1418 0 927 Jan-14-2024, 03:56 AM
Last Post: 1418
  Wrapping c/c++ dll Oolongtea 2 1,525 Aug-25-2023, 10:35 PM
Last Post: PyDan
  xml indent SubElements (wrapping) with multiple strings ctrldan 2 3,120 Jun-09-2023, 08:42 PM
Last Post: ctrldan
  Math python question Deonvek 6 2,274 Apr-05-2023, 09:27 PM
Last Post: deanhystad
  wrapping c++ library JESuh 2 1,956 Jun-16-2022, 08:18 AM
Last Post: JESuh
  math.log versus math.log10 stevendaprano 10 4,403 May-23-2022, 08:59 PM
Last Post: jefsummers
  Encrypt and decrypt in python using own fixed key SriRajesh 3 10,380 Feb-20-2022, 01:18 PM
Last Post: dboxall123
Question Opening small size browser with python selenium not work, need help greenpine 0 2,177 Feb-07-2022, 11:36 AM
Last Post: greenpine
  How to set Tab size to 4 in Python interpreter? zzzhhh 1 2,577 Jan-18-2022, 12:11 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020