Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
vala
vala
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 702
    • Issues 702
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 38
    • Merge Requests 38
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • GNOME
  • valavala
  • Issues
  • #96

Closed
Open
Opened May 15, 2010 by bugzilla-migration@bugzilla-migrationReporter

Add syntax sugar for 'pow' operation

Submitted by pancake

Link to original bug (#618740)

Description

I was looking for a way to do an exponent of an integer number, but resulted in that there's no way to do it in C or Vala a part from implement it by yourself. C's pow() lives in libm and it is for double and float, but not int.

I think it would be good for Vala to support '**' operator to call pow() or just implement it as an inline function, so the compiler can optimize to put a single opcode, or just keep it as a simple loop multiplying the value N times.

Python and many other languages support '**' and , we can probably think on the same, square roots are somewhat more dependant on floating point numbers, so maybe I would not implement sqrt in language.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/vala#96