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?
#9
Quote:I read about ctypes library. It has fixed-sized types, such as c_ulonglong, which seems to be exactly what I need. Unfortunately, I couldn't figure out how to multiply two c_ulonglong values, as Python gives error "unsupported operand" when trying to multiply a c_ulonglong with another c_ulonglong Confused
ctypes is a library that makes it easier to call C functions. It makes C-like data types, but it does not provide C math support. You would use ctypes to call your fixed size integer math equation from the C library that was installed as part of your portable Python package.

Some documentation about how you call C functions from Python.

https://docs.python.org/3/extending/extending.html
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  help seeking for prediction of fixed effect model gotodockforevildragon 1 248 Jun-23-2024, 08:09 AM
Last Post: johnthomson112
  Python code for alignment and font size 1418 0 442 Jan-14-2024, 03:56 AM
Last Post: 1418
  Wrapping c/c++ dll Oolongtea 2 856 Aug-25-2023, 10:35 PM
Last Post: PyDan
  Fixed colum width for rowLabels i Matplotlib pandabay 0 534 Jun-10-2023, 03:40 PM
Last Post: pandabay
  xml indent SubElements (wrapping) with multiple strings ctrldan 2 1,766 Jun-09-2023, 08:42 PM
Last Post: ctrldan
  Math python question Deonvek 6 1,406 Apr-05-2023, 09:27 PM
Last Post: deanhystad
  wrapping c++ library JESuh 2 1,411 Jun-16-2022, 08:18 AM
Last Post: JESuh
  math.log versus math.log10 stevendaprano 10 2,763 May-23-2022, 08:59 PM
Last Post: jefsummers
  Encrypt and decrypt in python using own fixed key SriRajesh 3 5,586 Feb-20-2022, 01:18 PM
Last Post: dboxall123
Question Opening small size browser with python selenium not work, need help greenpine 0 1,716 Feb-07-2022, 11:36 AM
Last Post: greenpine

Forum Jump:

User Panel Messages

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