exercism / exercism/php-representer

Normalize: Use float instead of double

Open
#146 7 comments 0 reactions 0 assignees View on GitHub
paused x:action/improve x:knowledge/none x:module/representer x:rep/small x:size/small x:type/coding
Dominant language
PHP
Stars
1
Forks
4
Avg merge
14h 18m
Merged PRs (30d)
1

Description

I came across this in the PHP track docs:

> - Casts `(float)` and `(real)` are normalized to `(double)`

Was there a discussion about that anywhere? Because `double` is not seen by PHP as a type, it is seen as an alias for `float` only:

> (double) and (real) are aliases of the (float) cast. These casts do not use the canonical type name and are not recommended.

Througout the PHP documentation `float` is used as the type for floating point numbers.

See:

- https://www.php.net/manual/en/language.types.type-system.php
- https://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.