Example #1
0
void Vector::set_component_signs(double direction)
{
    // Quadrant IV
    if(direction > 270.0) {
        Logger::write(Logger::string_stream << "set_component_signs - quadrant: IV");
        make_positive(x_component_);
        make_positive(y_component_);
    }
    // Quadrant III
    else if(direction > 180.0) {
        Logger::write(Logger::string_stream << "set_component_signs - quadrant: III");
        make_negative(x_component_);
        make_positive(y_component_);
    }
    // Quadrant II
    else if(direction > 90.0) {
        Logger::write(Logger::string_stream << "set_component_signs - quadrant: II");
        make_negative(x_component_);
        make_negative(y_component_);
    }
    // Quadrant I
    else  {
        Logger::write(Logger::string_stream << "set_component_signs - quadrant: I");
        make_positive(x_component_);
        make_negative(y_component_);
    }
}
Example #2
0
void	compute_wild_precision(t_mod *data, char *precizie)
{
	if (ft_strchr(data->result, '-'))
	{
		make_positive(data);
		precizie = ft_strjoin("-", precizie);
	}
	data->result = ft_strjoin(precizie, data->result);
	if (data->specifier == 'p')
		data->result = ft_strjoin("0x", data->result);
}
Example #3
0
void	compute_wild_width(t_mod *data, char *width)
{
	if (ft_strchr(data->result, '+') && data->zero_mod == 1)
	{
		make_positive(data);
		width = ft_strjoin("+", width);
	}
	if (data->wld_wsize < 0 || (data->specifier == 'p' && \
				data->zero_mod == 1 && data->result[0] == '0'))
		data->result = ft_strjoin(data->result, width);
	else
		data->result = ft_strjoin(width, data->result);
}